#ifndef CT_HTTP_IMPL_H_
#define CT_HTTP_IMPL_H_
#include "stdlib.h"
#include <string>
#include <map>

struct stHttpMemoryStruct {
        stHttpMemoryStruct()
        {
                memory = (char *)malloc(1);
                size = 0;
        }
        char *memory;
        size_t size;
};

class HttpImpl
{
        public:
                bool http_get(const std::string &url);
                bool http_post(const std::string &url, const std::string &postfields, const std::map<std::string, std::string> &postheader);

                void http_get_res(std::string &res); // equal: http_res(std::string &res);
                void http_res(std::string &res);
        private:
                stHttpMemoryStruct chunk;
};

#endif //CT_HTTP_IMPL_H_

